package com.sailors.common.task.sdk.core.model;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LinkedList;

/**
 * Excel upload dto
 * 示例数据: {
 *     "excelHeads": [
 *         "商品编号(请提交上架商品)",
 *         "星级(请输入数字1-5)",
 *         "评价内容（最多1000字符）",
 *         "failure reason"
 *     ],
 *     "excelRows": [
 *         {
 *             "商品编号(请提交上架商品)": "3sasasa商品编号",
 *             "星级(请输入数字1-5)": "3sa",
 *             "评价内容（最多1000字符）": "daad3sasadas",
 *             "failure reason": "sas"
 *         },
 *         {
 *             "商品编号(请提交上架商品)": "4商品sa编号",
 *             "星级(请输入数字1-5)": "4s",
 *             "评价内容（最多1000字符）": "d4aadsasadas",
 *             "failure reason": "4s"
 *         }
 *     ]
 * }
 *
 * @description: 上传excel支持
 * @author: cyj
 * @date 2023 -04-15 10:18:51
 */
@Data
@NoArgsConstructor
public class ExcelUploadDto {

    /**
     * 上传数据，对象key请和excelHeads对应避免出错
     *  excelHeads 每个元素都可以在 excelRows的每个JSONObject元素去get.
     */
    private LinkedList<JSONObject> excelRows;

    /**
     * excel的头
     */
    private LinkedList<String> excelHeads;

    public ExcelUploadDto(LinkedList<JSONObject> excelRows, LinkedList<String> excelHeads) {
        this.excelRows = excelRows;
        this.excelHeads = excelHeads;
    }
}
